﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.Xml.Linq;
using System.Xml.XPath;

namespace Autocomplete
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod]
        public static List<string> GetSeachResults(string search)
        {/*
            XDocument doc = XDocument.Load("CountryInfo.xml");

            var results = from x in doc.XPathSelectElements("/geonames/country/countryName")
                          where x.Value.StartsWith(search)
                          select x.Value;

            return  results.ToList();*/
            string[] s = new string[] {"jeeeeez iii", "dddd"};
            return s.ToList();

        }
        //geonames/country/countryName

        static Dictionary<string, string> Country = new Dictionary<string, string>();

        [WebMethod]
        public static Dictionary<string, string> GetCountryInfo(string countryname)
        {
            Country.Clear();
            Country.Add("name", "Danmark");
            Country.Add("capital", "copenhagen");
            return Country;
        }


    }
}